from django.contrib import admin
from .models.Residencia import Residencia
from .models.Servicio import Servicio
from .models.Comprobante import Comprobante
from .models.TipoPago import TipoPago
from .models.ServicioAd import ServicioAd
from .models.Persona import Persona
from .models.Contrato import Contrato
from .models.Consumo import Consumo
from .models.ServicioOp import ServicioOp


class ConsumoAdmin(admin.ModelAdmin):
    list_display = ("dateCreate", "estado")
    search_fields = ("dateCreate", "estado")
    list_per_page = 2


admin.site.register(Consumo, ConsumoAdmin)


class ResidenciaAdmin(admin.ModelAdmin):
    list_display = ("descripcion", "nombre_residencia",
                    "direccion", "num_habitacion", "telefono")
    search_fields = ("nombre_residencia", "num_habitacion", "direccion")
    list_per_page = 2


admin.site.register(Residencia, ResidenciaAdmin)


class ServicioAdmin(admin.ModelAdmin):
    list_display = ("nombre_servicio", "categoria",
                    "precio_servicio", "descripcion")
    search_fields = ("nombre_Servicio", "precio_servicio", "categoria")
    list_per_page = 2


admin.site.register(Servicio, ServicioAdmin)


class ComprobanteAdmin(admin.ModelAdmin):
    list_per_page = 2
    list_display = ("monto_total", "fecha_imicio", "fecha_pago", "estado")
    search_fields = ("monto_total", "fecha_imicio", "fecha_pago", "estado")

admin.site.register(Comprobante, ComprobanteAdmin)


class TipoPagoAdmin(admin.ModelAdmin):
    list_per_page = 2
    list_display = ("cuotas", "contado")
    search_fields = ("cuotas", "contado")

admin.site.register(TipoPago, TipoPagoAdmin)


class ServicioAdAdmin(admin.ModelAdmin):
    list_per_page = 2
    list_display = ("NomServicio", "descr", "Precio")
    search_fields = ("NomServicio", "descr", "Precio")


admin.site.register(ServicioAd, ServicioAdAdmin)


class PersonaAdmin(admin.ModelAdmin):
    list_per_page = 2
    list_display = ("nombre", "apPaterno", "apMaterno",
                    "tipoDoc", "numDoc", "direccion", "telefono", "email")
    search_fields = ("nombre", "apPaterno", "apMaterno",
                     "tipoDoc", "numDoc", "direccion", "telefono", "email")


admin.site.register(Persona, PersonaAdmin)


class ContratoAdmin(admin.ModelAdmin):
    list_per_page = 2
    list_display = ("fechareserva", "fechaingreso",
                    "fechasalida", "precioalquiler", "estado")
    search_fields = ("fechareserva", "fechaingreso",
                     "fechasalida", "precioalquiler", "estado")


admin.site.register(Contrato, ContratoAdmin)


class ServicioOpAdmin(admin.ModelAdmin):
    list_display = ("NomServicio", "descr", "Precio")
    search_fields = ("NomServicio", "descr", "Precio")
    list_per_page = 2


admin.site.register(ServicioOp, ServicioOpAdmin)
